package org.example.controller;

import org.example.entity.User;
import org.example.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    UserMapper mapper;
    @GetMapping("hello")
    public String hello() {
        return "hello world";
    }

    @GetMapping
    public User get(int id) {
        return mapper.getUser(id);

    }

}
